package common;

/**
 * This class holds several constants used throughout the program.
 * 
 * @author Zachary M. Allen
 * @author Andrew Bernard
 */
public class Constants {

  public static int PRUNE_THRESHOLD = 1;
  public static double PRUNE_UPPER_PCT = .1;
  public static double PRUNE_LOWER_PCT = .1;
  public static Integer MAX_INDEXED_TERMS_PER_FILE = new Integer(1000);
  public static char TERM_SEPARATOR = '\0';
  public static float PCT_OF_FILE_SIZE = .027F;  
  
  //User interaction errors
  public static final String ERR_GRAMMAR = "Incorrect query grammar";
  public static final String ERR_SYNTAX = "Incorrect command syntax";
  public static final String ERR_GENERIC = "Inappropriate request";
  public static final String ERR_CHARS = "Break characters cannot be searched for";
  public static final String ERR_OUTDATED_INDEX = "Result requested comes from a file changed after the index was created";
  
  //Keys to identify operators
  public static final char OP_OR = '|';
  public static final char OP_AND = '&';
  
  /** Name of the index file */
  public static final String INDEX_FILE = "DTI.out";
  
	/** First custom break character */
	public static final int FIRST_CUSTOM_BC = 32;

	/** Last custom break character */
	public static final int LAST_CUSTOM_BC = 126;
	
	/** End-of-file character */
	public static final int EOF = -1;
	
	/** Carriage return character */
	public static final char CR = 13;
	
	/** Line feed character */
	public static final char LF = 10;

	/** Number of bits to represent a month */
	public static final int MONTH_BITS = 4;
	
	/** Number of bits to represent a date */
	public static final int DATE_BITS = 5;
	
	/** Number of bits to represent a year */
	public static final int YEAR_BITS = 14;
	
	/** Number of bits to represent hours */
	public static final int HOUR_BITS = 5;
	
	/** Number of bits to represent minutes */
	public static final int MINUTE_BITS = 6;
	
	/** Number of bits to represent seconds */
	public static final int SECOND_BITS = 6;

	/** Number of bits used per bitmask */
	public static final int DEFAULT_BITS_PER_BITMASK = 64;

	/** Number of bits used to represent a file length */
	public static final int FILE_LENGTH_BITS = 8;

	/** The number of bits in one ASCII character */
	public static final int BITS_PER_ASCII_BYTE = 8;

	/** Number of bits used to represent total corpus chars */
	public static final int TOTAL_CORPUS_CHARS_BITS = 32;

	/** Number of bits used to represent total corpus words */
	public static final int TOTAL_CORPUS_WORDS_BITS = 32;

	/** Number of bits used to represent total corpus lines */
	public static final int TOTAL_CORPUS_LINES_BITS = 32;

	/** Number of bits representing the number of input files */
	public static final int NUM_INPUT_FILES_BITS = 16;

	/** Number of bits used to represent the number of bits used per offset */
	public static final int FILTER_LEN_BITS = 7;

	/** Number of bits used to represent file chars */
	public static final int FILE_CHARS_BITS = 32;

	/** Number of bits used to represent file words */
	public static final int FILE_WORDS_BITS = 32;

	/** Number of bits used to represent file lines */
	public static final int FILE_TERMS_BITS = 32;

  /** Number of bits used for the break characters bitmap */
  public static final int BREAK_CHARS_BITS = 95;

}